/*
    private Integer id;
     private String name;
     private String purpose;
     private String nameUk;
     private String suffix;
     private String spec;
     private Integer filesize;
     private Integer download;
     private String path;

 */
Ext.define('DCApp.model.CeAttachment', {
    extend: 'DCApp.model.Base',
    fields: [
        {name: 'id', type: 'int'},
        {name: 'name'},
        {name: 'purpose'},
        {name: 'nameUk'},
        {name: 'suffix'},
        {name: 'spec'},
        {name: 'filesize', type: 'int'},
        {name: 'download', type: 'int'},
        {name: 'path'},
        {name:'lastmod', type: 'date',  dateFormat: 'Y-m-d H:i:s'},
        {
            name: 'uri',
            calculate: function (data) {
              var path = data.path;
              if(path)
            	  path = path.replace(/\\/g,'/');
        	  var uri = '/fileopen?_dc='+new Date().getTime()+'&fp=/'+path; 
        	  return uri;
            }
        }
    ],
    rmap:{
    	'suffix':['jpg','jpg','doc','xls','pdf','zip']
    }
});
